package utils;

        import java.sql.Connection;
        import java.sql.DriverManager;
        import java.sql.SQLException;

/**
 * Created by guo on 2017/9/12.
 */
public class JDBCUtils {
    private static Connection con=null;
    public static Connection getConetion() throws SQLException {

        try {
            Class.forName("com.mysql.jdbc.Driver");
            con= DriverManager.getConnection("jdbc:mysql://localhost:3307/task","root","123456");
            return con;
        } catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }
    public static void close()
    {
        try{
            con.close();
        } catch (SQLException e) {
            e.printStackTrace();
        }
    }
}
